﻿using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using Matrix.MaKaYunShang.BLL;
using Matrix.MaKaYunShang.BLL.BllExt;
using Matrix.MaKaYunShang.BLL.WxInterfaceFunc;
using Matrix.MaKaYunShang.Model.MatrixCloudApi;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Matrix.MaKaYunShang.WebTest
{
    [TestClass]
    public class UnitTest1
    {
 
        [TestMethod]
        public void TestMethod1()
        {
         var ss=   UserCardBLL.Instance.GetUserCardList(1, 22,1,
                            1);
        }

        
        [TestMethod]
        public void SS()
        {
            string content =
            "{{first.DATA}}\n更新时间：{{keyword1.DATA}}\n订单类型：{{keyword2.DATA}}\n订单状态：{{keyword3.DATA}}\n订单来源：{{keyword4.DATA}}\n订单详情：{{keyword5.DATA}}\n{{remark.DATA}}";

            GetMsgTemplateKeys(content);

        }

        private List<string> GetMsgTemplateKeys(string msgTemplateContent)
        {
            var result = new List<string>();
            var reg = new Regex(@"{{(\w+)?.DATA}}");
            var matchs = reg.Matches(msgTemplateContent);
            for (var i = 0; i < matchs.Count; i++)
            {
                result.Add(matchs[i].Value.Trim('{').Trim('}').Replace(".DATA", ""));
            }
            return result;
        }

        [TestMethod]
        public void DealEWaterCouponAfterConsumerUnbindingTest()
        {
            var orderExtBll = new OrderExtBll();
            orderExtBll.DealEWaterCouponAfterConsumerUnbinding(6, 3136, 87, 2, 3);
        }
    }
}
